package com.jumper.property.comparer.demo.logger;

import com.jumper.property.comparer.core.enums.LogTable;
import com.jumper.property.comparer.core.support.AbstractLogManager;
import com.jumper.property.comparer.core.support.LogRepository;
import com.jumper.property.comparer.demo.enums.LogTableEnum;
import com.jumper.property.comparer.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 订单日志管理器
 */
@Component
public class OrderLogManager extends AbstractLogManager<String> {

    public OrderLogManager(LogRepository repository) {
        super(repository);
    }

    @Autowired
    private OrderService orderService;

    @Override
    public LogTable getBusType() {
        return LogTableEnum.ORDER_LOG;
    }

    @Override
    public Object getOptData(String orderNum) {
        return orderService.getOrder(orderNum);
    }
}
